home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0971.dms / q0971.adf / programmer / prog / plot.a < prev    next >
Text File  |  1997-04-10  |  764b  |  61 lines

  1.     csect    text,0,0,1,2
  2.  
  3.     include    "intuition/intuition.i"
  4.     include    "graphics/rastport.i"
  5.     include    "graphics/gfx.i"
  6.  
  7.     xdef    _MultiPlot
  8.  
  9. _MultiPlot:
  10.     cmp.w    sc_Width(a0),d0
  11.     bcc    quit
  12.  
  13.     cmp.w    sc_Height(a0),d1
  14.     bcc    quit
  15.  
  16.     movem.l    d3/d4,-(sp)
  17.  
  18.     move.l    sc_RastPort+rp_BitMap(a0),a0
  19.     moveq    #0,d4
  20.     moveq    #0,d3
  21.     move.w    bm_BytesPerRow(a0),d4
  22.     move.b    bm_Depth(a0),d3
  23.     lea.l    bm_Planes(a0),a0
  24.  
  25.     mulu    d4,d1
  26.     move.l    d0,d4
  27.     lsr    #3,d0
  28.     add    d0,d1
  29.     not    d4
  30.     subq    #1,d3
  31.  
  32. loop    move.l    (a0)+,a1
  33.     lsr.b    #1,d2
  34.     bcc    clear
  35.     bset    d4,0(a1,d1.l)
  36.     dbra    d3,loop
  37.  
  38. exit    movem.l    (sp)+,d3/d4
  39. quit    rts
  40.  
  41. clear    bclr    d4,0(a1,d1.l)
  42.     dbra    d3,loop
  43.     bra    exit
  44.  
  45.     xdef    _MonoPlot
  46.  
  47. _MonoPlot:
  48.     cmp.w    d3,d0
  49.     bcc    1$
  50.     cmp.w    d4,d1
  51.     bcc    1$
  52.     mulu    d2,d1
  53.     move    d0,d2
  54.     lsr    #3,d0
  55.     add    d0,d1
  56.     not    d2
  57.     bset    d2,0(a0,d1)
  58. 1$    rts
  59.  
  60.     end
  61.